<template>
  <div class="login-form">
    <div class="login-title">
      二维码登录
    </div>
    <wxlogin class="login-code"
             appid="wx0f17aec221a41217"
             scope="snsapi_login" :theme="'black'"
             self_redirect="false" :state="(Math.ceil(Math.random() * 1000)).toString()"
             :redirect_uri='"http%3a%2f%2fwww.gcjlkj.cn%2fadmin%2flogin.aspx"'
             :href="'data:text/css;base64,LmltcG93ZXJCb3ggLnFyY29kZSB7d2lkdGg6MjIwcHg7Ym9yZGVyOiAwcHggc29saWQgI0UyRTJFMjttYXJnaW4tdG9wOiAwcHg7fQouaW1wb3dlckJveCAudGl0bGUge2Rpc3BsYXk6IG5vbmU7fQouaW1wb3dlckJveCAuaW5mbyB7d2lkdGg6IDIyMHB4O30KLnN0YXR1c19pY29uIHtkaXNwbGF5OiBub25lO30KLmltcG93ZXJCb3ggLnN0YXR1cyB7dGV4dC1hbGlnbjogY2VudGVyO30KLmltcG93ZXJCb3ggLnN0YXR1cyBwICB7ZGlzcGxheTogbm9uZTt9'">
    </wxlogin>
    <div class="login-btn">
      <el-button @click="back">返回</el-button>
    </div>
  </div>
</template>

<script lang="ts" setup>
import wxlogin from 'vue-wxlogin'

const emit = defineEmits(['on-click'])
const back = () => {
  emit('on-click', 0)
}
</script>

<style lang="scss" scoped>
.login-form {
  display: flex;
  align-items: center;
  flex-direction: column;

  .login-title {
    margin-bottom: 20px;
  }

  .login-code {
    width: 300px;
    height: 250px;
  }
}
</style>
